
HL_TARGET:=0

ifeq ($(HL_TARGET), 0)
CROSS:=
else ifeq ($(HL_TARGET), 1)
CROSS:=aarch64-linux-gnu-
endif

C =$(CROSS)gcc
CFLAGS = -Wall -Os -g -rdynamic#-O -g
TARGET = ./hldev #../bin/hlapp
HEAD=-I ../include/  # 头文件目录

LIBDIR=-L ../lib/  # 库文件目录
LIBS= -lhlp2p_linux_x86_64 -pthread -lm # 库文件

STRIP:=$(CROSS)strip
RANLIB:=$(CROSS)ranlib

./out/%.o:%.c
	$(C) $(HEAD) $(CFLAGS) -c $< -o $@

SOURCES = $(wildcard *.c) 
OBJS = $(patsubst %.c,./out/%.o,$(SOURCES))
 
#生成可执行文件
$(TARGET):$(OBJS)
	$(C) $(HEAD) $(OBJS) $(LIBDIR) $(LIBS) -o $(TARGET)
# 	$(STRIP) $(TARGET)
	chmod a+x $(TARGET)
 
clean:
	rm -rf ./out/*.o $(TARGET)

